package com.atfcm.arr;

/**
 * @Author whaty
 * @create 2024/10/18 16:30
 */
public class t724 {
    public static void main(String[] args) {

    }

    public static int pivotIndex(int[] nums) {
        int cur = 0;
        int centerCur = -1;
        for (int i = 0; i < nums.length; i++) {
            int leftSum = 0;
            int rightSum = 0;
            for (int j = 0; j <= cur-1; j++) {
                leftSum += nums[j];
            }
            for (int j = cur+1; j < nums.length; j++) {
                rightSum += nums[j];
            }
            if(leftSum == rightSum){
                centerCur = cur;
                break;
            }
            cur++;
        }
        return centerCur;
    }
}
